﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WebHoiChoMuaBan.Models;

namespace WebHoiChoMuaBan.Controllers.Helpers
{
    public class NewsTypeHelper : HelperBase
    {
        public NewsTypeHelper() : base(){}

        public List<NewsType> GetAllNewsType()
        {
            var newsType = from n in this.dataContext.NewsTypes
                           select n;
            return newsType.ToList();
        }
        //
        // Insert/Delete Methods

        public void Add(NewsType page)
        {
            this.dataContext.NewsTypes.InsertOnSubmit(page);
        }

        public void Save()
        {
            this.dataContext.SubmitChanges();
        }
    }
}